package com.joycessh.study.controller;

import com.joycessh.study.bean.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author Joycessh
 * @Description
 * @Date 7/27/19 4:16 PM
 */
@RestController // 该注解整合了@Controller和@ResponseBody 两个注解，符合restful的风格
public class HelloController {

    @Resource
    private Person person;

    @RequestMapping(value = "/hello", method = RequestMethod.GET)
    public Person hello() {
        return person;
    }
}
